package com.lanou3g.demo.service.impl;

import com.lanou3g.demo.controller.params.ServiceParams;
import com.lanou3g.demo.entity.Account;
import com.lanou3g.demo.entity.Cost;
import com.lanou3g.demo.entity.Service;
import com.lanou3g.demo.mapper.ServiceMapper;
import com.lanou3g.demo.service.IServiceService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
@org.springframework.stereotype.Service
public class ServiceService implements IServiceService {
    @Autowired
    private ServiceMapper serviceMapper;


    /**
     * 查询业务账号的信息
     * @return
     */
    @Override
    public List<Service> findAllService() {
        return serviceMapper.findAllService();
    }

    /**
     * 修改状态
     * @param serviceId
     * @return
     */
    @Override
    public int updateStatus(Integer serviceId) {
        return serviceMapper.updateStatus(serviceId);
    }

    /**
     * 删除状态
     * @param serviceId
     * @return
     */
    @Override
    public int delStatus(Integer serviceId) {
        return serviceMapper.delStatus(serviceId);
    }

    /**
     * 查询业务账号个人信息
     * @param
     * @return
     */
    @Override
    public List<Service> findByOne(ServiceParams serviceParams) {
      return   serviceMapper.findByOne(serviceParams);
    }

    /**
     * 通过身份证查询账务账号
     * @param
     * @return
     */
    @Override
    public List<Account> findAccountName(Account account) {
        return serviceMapper.findAccountName(account);
    }
    //添加service信息
    @Override
    public int addService(Service service) {
        return serviceMapper.addService(service);
    }
    //通过资费类型name查询cost表的costId
    @Override
    public List<Cost> findCostName() {

     return serviceMapper.findCostName();

    }

    @Override
    public void updateName(Service service) {
      serviceMapper.updateName(service);
    }
}
